package com.zbkj.dal.base.enums;

import com.zbkj.dal.base.enums.show.EnumInterface;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.util.Objects;

@AllArgsConstructor
public enum OrderDeliveryType implements EnumInterface<Integer> {


    /**
     *
     */
    // 快递到家
    BACK(1, "快递到家"),
    // 到店自提
    SCRAP(2, "到店自提"),
    ;

    private final Integer code;
    private final String message;


    @Override
    public Integer code() {
        return code;
    }

    @Override
    public String desc() {
        return message;
    }

    public static String of(Integer code) {
        for (OrderDeliveryType value : OrderDeliveryType.values()) {
            if (Objects.equals(code, value.code)) {
                return value.message;
            }
        }
        return StringUtils.EMPTY;
    }
}
